﻿package payments;

public class Translit {

	static String translit(String str){
	
		char[]	 r={'а','б','в','г','д','е','ё', 'ж','з','и','й','к','л','м','н','о','п','р','с','т','у','ф','х', 'ц', 'ч', 'ш', 'щ','ъ','ы','ь','э','ю', 'я'};			
		String[] e={"a","b","v","g","d","e","e","zh","z","i","i","k","l","m","n","o","p","r","s","t","y","f","h","ts","ch","sh","sh","`","i","`","e","u","ya"};
		
		char[] ch = str.toLowerCase().toCharArray();
			
		String s = "";
		String s1 = "";
			
		int i;
		int j;
		for(i = 0; i < ch.length; i++){
			for(j = 0; j < r.length; j++){
				if (ch[i] == r[j]){
					s1 = e[j];
					break;
				}
				else {
					s1 = "_";
				}
			}
			s = s + s1;
		}

		return s;
	}
}
